package oschina.zhangchaozheng.demo.demo_1_7.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import oschina.zhangchaozheng.demo.demo_1_7.model.User;

/**
 * Created by zcz on 2017/9/6.
 */
@Mapper
public interface UserMapper {

    @Select("select * from user where id=#{id}")
    User getUser(@Param("id") long id);


    @Insert("INSERT INTO `user` (`name`, `age`) VALUES (#{u.name},#{u.age});")
    int createUser(@Param("u") User user);
}
